import {request,hotelRequest,otherRequest} from '@/sheep/request';

const baseURL=import.meta.env.SHOPRO_MORE_DEV_URL
export default {
	
	// 分销中心///////////////////
	giveaway:{
		// 入驻支付列表////////
		vipList: (params) =>
			otherRequest({
				url: '/operations/api/merchCheckIn/needPay',
				method: 'GET',
				params,
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
		// 发起支付
		prepay: (data) =>
			otherRequest({
				url: '/operations/api/merchCheckIn/prepay',
				method: 'POST',
				data,
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
		shareList: (data) =>
			otherRequest({
				url: '/shop/api/share/share',
				method: 'GET',
				data,
			}),
		///////////////
		// 订单详情
		detail: (id) =>
			request({
				url: 'order/order/' + id,
				method: 'GET',
			}),
		// 创建订单
		create: (data) =>
			request({
				url: '/shop/api/user/role/create',
				method: 'POST',
				data,
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
		roleList: () =>
			request({
				url: '/shop/api/user/role',
				method: 'GET',
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
		// bd等查询是否填写资料
		cooperation: (params) =>
			request({
				baseURL,
				url: '/shop/api/cooperation/crud',
				method: 'GET',
				params,
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
		// 填写资料-bd
		write: (data) =>
			request({
				baseURL,
				url: '/shop/api/cooperation/crud',
				method: 'POST',
				data,
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
		// 修改资料-bd
		writeEdit: (id,data) =>
			request({
				baseURL,
				url: `/shop/api/cooperation/crud/${id}`,
				method: 'PUT',
				data,
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
		// 
		getUserInfo: () =>
			request({
				baseURL,
				url: '/operations/api/apply/getUserInfo',
				method: 'GET',
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
	},
	merchant:{
		// 查询卡是否已绑定
		card_is_bind: (bd_no) =>
			hotelRequest({
				url: `/user/api/nfcBind/check/${bd_no}`,
				method: 'GET',
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
			// 绑定编号接口
		card_bind: (data) =>
			hotelRequest({
				url: '/user/api/nfcBind/bind',
				method: 'POST',
				data,
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
		// 绑定上级
		bindParent: (data) =>
			hotelRequest({
				url: '/user/api/nfcBind/bindParent',
				method: 'POST',
				data,
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
		
		///////////////////////////
		// 乐刷进件
		//mcc列表
		mccList: (data) =>
			otherRequest({
				url: '/leshua/api/pay/mcc',
				method: 'GET',
				data,
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
		// /////////////////////////
		
		getInviteInfo: (data) =>
			request({
				baseURL,
				url: '/operations/api/getBdUserInfo',
				method: 'GET',
				data,
				custom: {
					showLoading: false,
					showError: false,
				},
			}),

		getShopDetail: (data) =>
			request({
				baseURL,
				url: '/operations/api/getShopInfo',
				method: 'GET',
				data,
				custom: {
					showLoading: false,
					showError: false,
				},
			}),

		applyAdd: (data) =>
			request({
				baseURL,
				url: '/operations/api/apply/add',
				method: 'POST',
				data,
				custom: {
					loadingMsg: '提交中',
					showLoading: false,
					showError: false,
				},
			}),
		// 惊喜生活-----------------------
			// 测试域名
			applyAddTest: (data) =>
				request({
					baseURL,
					url: '/operations/api/apply/add',
					method: 'POST',
					data,
					custom: {
						showLoading: true,
						showError: true,
					},
				}),
			// 详情测试域名
			applyDetailTest: (id) =>
				request({
					baseURL,
					url: `/operations/api/apply/detail/${id}`,
					method: 'GET',
					custom: {
						showLoading: true,
						showError: false,
					},
				}),
			// 修改测试域名
			applyEditTest: (id,data) =>
				request({
					baseURL,
					url: `/operations/api/apply/edit/${id}`,
					method: 'PUT',
					data,
					custom: {
						showLoading: true,
						showError: true,
					},
				}),
		// //////////////////////////
	applyList: (params) =>
		request({
			baseURL,
			url: '/operations/api/apply/list',
			method: 'GET',
			params,
			custom: {
				showLoading: false,
				showError: false,
			},
		}),
		getBankList: (params) =>
			request({
				baseURL,
				url: '/operations/api/getBankList',
				method: 'GET',
				params,
				custom: {
					showLoading: false,
					showError: false,
				},
			})
	},
	getDefaultImg:(params) => {
		return request({
			url:'/shop/yb/shDefData',
			method: 'GET',
			params,
			custom: {
				showLoading: false,
				showError: false,
			},

		})
	},
	// 分销商详情
	agent: () =>
		request({
			url: 'commission/agent',
			method: 'GET',
			custom: {
				showLoading: false,
				showError: false,
			},
		}),
	// 分销表单
	form: () =>
		request({
			url: 'commission/agent/form',
			method: 'GET',
		}),
	// 申请分销商
	apply: (data) =>
		request({
			url: 'commission/agent/apply',
			method: 'POST',
			data,
			custom: {
				showSuccess: true,
			},
		}),
	// 分销动态
	log: (params) =>
		request({
			url: 'commission/log',
			method: 'GET',
			params,
		}),
	// 分销订单
	order: (params) =>
		request({
			url: 'commission/order',
			method: 'GET',
			params,
		}),
	// 分销商品
	goods: (params) =>
		request({
			url: 'commission/goods',
			method: 'GET',
			params,
		}),
	// 我的团队
	team: (params) =>
		request({
			url: 'commission/agent/team',
			method: 'GET',
			params,
		}),
	// 佣金转余额
	transfer: (data) =>
		request({
			url: 'commission/agent/transfer',
			method: 'POST',
			data,
		}),
	//申请入驻
	applyadd: (data) =>
		request({
			url: 'hotel/apply/add',
			method: 'POST',
			data,
		}),
	//申请入驻状态
	getStatus: (data) =>
		request({
			url: 'hotel/apply/getStatus',
			method: 'GET',
			data,
		}),
	// 获取已经认证通过
	getType: (data) =>
		request({
			url: 'hotel/roles/getType',
			method: 'GET',
			data,
		}),
	// 我的团队
	myTeam: (data) =>
		request({
			url: 'hotel/company/myTeam',
			method: 'POST',
			data,
		}),
	//邀请码
	generateQrCode: (data) =>
		request({
			url: 'hotel/apply/generateQrCode1',
			method: 'POST',
			data,
		}),

	//别的渠道商/创客详情 
	getDetail: (data) =>
		request({
			url: 'hotel/salesman/getDetail',
			method: 'GET',
			data,
		}),

	//酒店详情
	getDetailout: (data) =>
		request({
			url: 'hotel/outlets/getDetail',
			method: 'GET',
			data,
		}),

	//我的团队
	myDetail: (data) =>
		request({
			url: 'hotel/company/myDetail',
			method: 'POST',
			data,
		}),
	// 门店列表
	getSelect: (data) =>
		request({
			url: 'hotel/outlets/getSelect',
			method: 'GET',
			data,
		}),
	// 账户明细列表
	moneyList: (data) =>
		request({
			url: 'hotel/outletsMoney/list',
			method: 'POST',
			data,
		}),
	//银行卡列表
	cardList: (data) =>
		request({
			url: 'hotel/bank/list',
			method: 'POST',
			data,
		}),
	//添加银行卡
	cardAdd: (data) =>
		request({
			url: 'hotel/bank/add',
			method: 'POST',
			data,
		}),
	//根据编辑银行卡
	cardEditById: (data) =>
		request({
			url: 'hotel/bank/detail',
			method: 'GET',
			data,
		}),
	//编辑后保存
	cardEditSave: (data) =>
		request({
			url: 'hotel/bank/edit',
			method: 'POST',
			data,
		}),
	//提现页面信息	
	prepare: (data) =>
		request({
			url: 'hotel/withdraw/prepare',
			method: 'GET',
			data,
		}),
	//提现
	withdraws: (data) =>
		request({
			url: 'hotel/withdraw/add',
			method: 'POST',
			data,
		}),	
	//添加门店
	addStore: (data) =>
		request({
			url: 'hotel/outlets/add',
			method: 'POST',
			data,
		}),
	getRoleList: () =>
		request({
			url: 'hotel/more/identity',
			method: 'get',
		}),	
	getChoiceList: () =>
		request({
			url: 'hotel/more/choice',
			method: 'get',
		}),	
	getApplyedMobileAndName: () =>
		request({
			url: 'hotel/more/getMobileAndName',
			method: 'get',
		}),	
	switchIdenfityLogin: (data) =>
		request({
			url: 'hotel/more/role',
			method: 'post',
			data,
		}),	
	storeList: (data) =>
		request({
			url: 'hotel/apply/poi',
			method: 'POST',
			data,
		}),		
	getApplyed: (data) =>
		request({
			url: 'hotel/apply/poiStatus',
			method: 'GET',
		}),	
};